/**
 * Implementaiton of peel edge entity.
 *
 * \file edge_impl.hpp
 * \author tomby
 * \date 04-01-2009
 **/

/*  Copyright (C) 2009  Tomas 'tomby' Bily

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>. */


#ifndef __DBC_EDGE_IMPL__
#define __DBC_EDGE_IMPL__

namespace dbc {
  namespace peel {
    class Node;

    inline void Edge::add_in_node (Node* node)
    { add_producer (node); }

    inline void Edge::add_out_node (Node* node)
    { add_consumer (node); }

    inline Edge::node_iter Edge::begin_in_node ()
    { return Edge::node_iter (get_producers ()->begin ()); }

    inline Edge::node_iter Edge::end_in_node ()
    { return Edge::node_iter (get_producers ()->end ()); }

    inline Edge::node_iter Edge::begin_out_node ()
    { return Edge::node_iter (get_consumers ()->begin ()); }

    inline Edge::node_iter Edge::end_out_node ()
    { return Edge::node_iter (get_consumers ()->end ()); }
  };
};

#endif
